package com.leo.controller;

import com.leo.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName: HelloWorldController
 * @Description: 测试类
 * @Author: leo825
 * @Date: 2020-05-14 21:42
 * @Version: 1.0
 */
@Controller
public class HelloWorldController {
    @Autowired
    UserInfoService userInfoService;

    @RequestMapping(value = "/helloworld")
    public String helloWorld() {
        System.out.println("helloWorld");
        return "success";
    }

    @RequestMapping(value = "/getUserInfoList", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    @ResponseBody
    public String getUserInfoList() {
        System.out.println("getUserInfoList");
        String result = userInfoService.getUserInfoList().toString();
        System.out.println(result);
        return result;
    }
}
